
/**
 * 封装导出Excal文件请求
 * @param url
 * @param data
 * @param excelName  // excal名称
 * @returns {Promise}
 */
// let BaseURL = 'http://api.kyhddsp.com'
let BaseURL = 'http://devapi.dmxiaoshuo.cn'
export function exportExcel(url,options) {
  this.$http({
    method: "post",
    url: url,
    data: options
  }).then(res => {
    if (window.navigator.msSaveOrOpenBlob) {
      // navigator.msSaveBlob(blob, fileName)
    } else {
      var link = document.createElement('a')
      link.href = res.data.data
      // console.log(response.data.data)
      link.click()
      //释放内存
      window.URL.revokeObjectURL(link.href)
    }
  });
}